package com.zpark.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zpark.entity.Cv;
import com.zpark.mapper.CvMapper;
import com.zpark.service.ICvService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lx
 * @since 2024-03-18
 */
@Service
public class CvServiceImpl extends ServiceImpl<CvMapper, Cv> implements ICvService {
@Resource
private CvMapper mapper;
    @Override
    public List selectAll() {
        List<Cv> cvs = mapper.selectList(null);
        return cvs;
    }

    @Override
    public List likeQuery(String key) {
        QueryWrapper<Cv> wrapper = new QueryWrapper<>();
        wrapper.like("desired_direction",key);
        List cvs = mapper.selectList(wrapper);
        return cvs;
    }

    @Override
    public boolean updateBase(Cv cv) {
        int i = mapper.updateById(cv);
        System.out.println(i);
        return i==0?false:true;
    }
}
